<h2>My Heroes</h2>
<div>
    <label>Hero name:</label> <input #heroName />
    <button (click)="add(heroName.value); heroName.value=''">
    Add
  </button>
</div>
<ul class="heroes">
    <li *ngFor="let hero of heroes$ | async" (click)="onSelect(hero)" [class.selected]="hero === (selectedHero$ | async)">
        <span class="badge">{{hero.id}}</span>
        <span>{{hero.name | shorten: 10: '...'}}</span>
        <button class="delete" (click)="delete(hero); $event.stopPropagation()">x</button>
    </li>
</ul>
<div *ngIf="(selectedHero$ | async)">
    <h2>
        {{(selectedHero$ | async)?.name | uppercase}} is my hero
    </h2>
    <button (click)="gotoSelectedHero()">View Details</button>
</div>


<!--
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->
